package com.whalefin.controller.leaveMessage;


import com.whalefin.service.LeaveMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


/**
 * Created by frank on 4/24/14.
 */
@Controller
@RequestMapping(value = "/leaveMessage/updateStatus")
public class UpdateStatusController {

	@Autowired
	private LeaveMessageService leaveMessageService;

	@RequestMapping(method = RequestMethod.GET)
	public String get(Integer id,String status) {

        if (status.equals("hide")) {
            status = "隐藏";
            leaveMessageService.updateStatus(id, status);
        } else if (status.equals("show")) {
            status = "显示";
            leaveMessageService.updateStatus(id, status);
        }
		return "redirect:/leaveMessage/leaveMessageList";
	}


}
